/**
 * @file sampleRouter.h
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2024-07-20
 * 
 * @copyright Copyright (c) 2024
 * 
 */

#pragma once
#include "httpSvr/router.h"

namespace wheels
{

class SampleRouter: public IRouter
{
public:
    using Handler = std::function<void(Request&, Response&)>;

public:
    SampleRouter() = default;
    ~SampleRouter() =default;

    int Register(const char *path, HttpMethod method, Handler handler);

    Handler GetHandler(const char *path, HttpMethod method);

private:
    using HandlerMap = std::unordered_map<std::string, Handler>;
    std::array<HandlerMap, (int)HttpMethod::NUMBER> m_handlers;
};

} // namespace wheels
